package edu.gdut.thesissys.vo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * PaperTitle entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "paper_title", catalog = "gdutmis")
public class PaperTitle extends BaseVo implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8645200144372206224L;
	// Fields

	private Integer paperTitleId;
	private Teacher teacher;
	private Department department;
	private String name;
	private String direcetion;
	private String type;
	private String source;
	private String introduction;
	private String standard;
	private Integer limitNum;
	private Integer choicedNum;
	private String auditingIdea;
	private Date distributeTime;
	private String isPassed;
	private String forGrade;
	private Set<StudentChooseTitle> studentChooseTitles = new HashSet<StudentChooseTitle>(
			0);
	private Set<Adjust> adjustsForTitleIdBefore = new HashSet<Adjust>(0);
	private Set<Adjust> adjustsForTitleIdAfter = new HashSet<Adjust>(0);

	// Constructors

	/** default constructor */
	public PaperTitle() {
	}

	/** minimal constructor */
	public PaperTitle(String name, String direcetion, String type,
			String source, String introduction, Integer limitNum) {
		this.name = name;
		this.direcetion = direcetion;
		this.type = type;
		this.source = source;
		this.introduction = introduction;
		this.limitNum = limitNum;
	}

	/** full constructor */
	public PaperTitle(Teacher teacher, Department department, String name,
			String direcetion, String type, String source, String introduction,
			String standard, Integer limitNum, Integer choicedNum,
			String auditingIdea, Date distributeTime, String isPassed,
			String forGrade, Set<StudentChooseTitle> studentChooseTitles,
			Set<Adjust> adjustsForTitleIdBefore,
			Set<Adjust> adjustsForTitleIdAfter) {
		this.teacher = teacher;
		this.department = department;
		this.name = name;
		this.direcetion = direcetion;
		this.type = type;
		this.source = source;
		this.introduction = introduction;
		this.standard = standard;
		this.limitNum = limitNum;
		this.choicedNum = choicedNum;
		this.auditingIdea = auditingIdea;
		this.distributeTime = distributeTime;
		this.isPassed = isPassed;
		this.forGrade = forGrade;
		this.studentChooseTitles = studentChooseTitles;
		this.adjustsForTitleIdBefore = adjustsForTitleIdBefore;
		this.adjustsForTitleIdAfter = adjustsForTitleIdAfter;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "paper_title_id", unique = true, nullable = false)
	public Integer getPaperTitleId() {
		return this.paperTitleId;
	}

	public void setPaperTitleId(Integer paperTitleId) {
		this.paperTitleId = paperTitleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teacher_id")
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "department_id")
	public Department getDepartment() {
		return this.department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

	@Column(name = "name", nullable = false, length = 30)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "direcetion", nullable = false, length = 50)
	public String getDirecetion() {
		return this.direcetion;
	}

	public void setDirecetion(String direcetion) {
		this.direcetion = direcetion;
	}

	@Column(name = "type", nullable = false, length = 14)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Column(name = "source", nullable = false, length = 18)
	public String getSource() {
		return this.source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	@Column(name = "introduction", nullable = false)
	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}

	@Column(name = "standard")
	public String getStandard() {
		return this.standard;
	}

	public void setStandard(String standard) {
		this.standard = standard;
	}

	@Column(name = "limit_num", nullable = false)
	public Integer getLimitNum() {
		return this.limitNum;
	}

	public void setLimitNum(Integer limitNum) {
		this.limitNum = limitNum;
	}

	@Column(name = "choiced_num")
	public Integer getChoicedNum() {
		return this.choicedNum;
	}

	public void setChoicedNum(Integer choicedNum) {
		this.choicedNum = choicedNum;
	}

	@Column(name = "auditing_idea")
	public String getAuditingIdea() {
		return this.auditingIdea;
	}

	public void setAuditingIdea(String auditingIdea) {
		this.auditingIdea = auditingIdea;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "distribute_time", length = 10)
	public Date getDistributeTime() {
		return this.distributeTime;
	}

	public void setDistributeTime(Date distributeTime) {
		this.distributeTime = distributeTime;
	}

	@Column(name = "is_passed", length = 1)
	public String getIsPassed() {
		return this.isPassed;
	}

	public void setIsPassed(String isPassed) {
		this.isPassed = isPassed;
	}

	@Column(name = "for_grade", length = 4)
	public String getForGrade() {
		return this.forGrade;
	}

	public void setForGrade(String forGrade) {
		this.forGrade = forGrade;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paperTitle")
	public Set<StudentChooseTitle> getStudentChooseTitles() {
		return this.studentChooseTitles;
	}

	public void setStudentChooseTitles(
			Set<StudentChooseTitle> studentChooseTitles) {
		this.studentChooseTitles = studentChooseTitles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paperTitleByTitleIdBefore")
	public Set<Adjust> getAdjustsForTitleIdBefore() {
		return this.adjustsForTitleIdBefore;
	}

	public void setAdjustsForTitleIdBefore(Set<Adjust> adjustsForTitleIdBefore) {
		this.adjustsForTitleIdBefore = adjustsForTitleIdBefore;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "paperTitleByTitleIdAfter")
	public Set<Adjust> getAdjustsForTitleIdAfter() {
		return this.adjustsForTitleIdAfter;
	}

	public void setAdjustsForTitleIdAfter(Set<Adjust> adjustsForTitleIdAfter) {
		this.adjustsForTitleIdAfter = adjustsForTitleIdAfter;
	}

}